package com.lee.service.impl;

import com.lee.bean.Staff;
import com.lee.mapper.StaffMapper;
import com.lee.service.StaffService;
import com.lee.util.AjaxResult;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * Created by dllo on 18/4/17.
 */
@Service
public class StaffServiceImpl implements StaffService {
    @Resource
    private StaffMapper staffMapper;
    @Override
    public AjaxResult doLogin(Staff staff) {
        AjaxResult result = new AjaxResult();
        Staff findStaff = staffMapper.selectStaff(staff);
        if (findStaff == null){
            result.setCode("0");
            result.setMessage("用户名或密码错误");
            return result;
        }
        result.setCode("1");
        result.setMessage("登陆成功");
        result.setData(findStaff);
        return result;
    }
}
